/* 
通过axios建立的服务，调用get/post的请求方法
*/

import request from '@/utils/request'

//登录接口
export const getLogin = (info) => {
    return request.post("user/login", info)
}


//用户信息接口
export const getUserInfo = () => {
    return request.get("user/getUserInfo")
}

//注册校验接口
export const registerValidate = (username) => {
    return request({
        method: "post",
        url: "user/checkUserName",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
        },
        data: `username=${username}`
    })
}

//用户注册
export const registerApi = (user) => {
    return request.post("user/register", user)
}

//检查登录
export const isUserOverdue = ()=>{
    return request.get("user/checkLogin")
}
